// This file is part of Acala.

// Copyright (C) 2020-2025 Acala Foundation.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for module_homa_validator_list
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-04-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `192.168.1.2`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: Compiled, CHAIN: Some("acala-dev"), DB CACHE: 1024

// Executed Command:
// target/production/acala
// benchmark
// pallet
// --chain=acala-dev
// --steps=50
// --repeat=20
// --pallet=*
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./templates/runtime-weight-template.hbs
// --output=./runtime/acala/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for module_homa_validator_list.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> module_homa_validator_list::WeightInfo for WeightInfo<T> {
	// Storage: `Tokens::Accounts` (r:1 w:1)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `HomaValidatorList::TotalLockedByGuarantor` (r:1 w:1)
	// Proof: `HomaValidatorList::TotalLockedByGuarantor` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `MaxEncodedLen`)
	// Storage: `HomaValidatorList::Guarantees` (r:1 w:1)
	// Proof: `HomaValidatorList::Guarantees` (`max_values`: None, `max_size`: Some(141), added: 2616, mode: `MaxEncodedLen`)
	// Storage: `HomaValidatorList::ValidatorBackings` (r:1 w:1)
	// Proof: `HomaValidatorList::ValidatorBackings` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Locks` (r:1 w:1)
	// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1300), added: 3775, mode: `MaxEncodedLen`)
	fn bond() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2388`
		//  Estimated: `4765`
		// Minimum execution time: 36_000 nanoseconds.
		Weight::from_parts(37_000_000, 4765)
			.saturating_add(T::DbWeight::get().reads(5))
			.saturating_add(T::DbWeight::get().writes(5))
	}
	// Storage: `HomaValidatorList::Guarantees` (r:1 w:1)
	// Proof: `HomaValidatorList::Guarantees` (`max_values`: None, `max_size`: Some(141), added: 2616, mode: `MaxEncodedLen`)
	// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
	// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0)
	// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	fn unbond() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1506`
		//  Estimated: `3606`
		// Minimum execution time: 19_000 nanoseconds.
		Weight::from_parts(20_000_000, 3606)
			.saturating_add(T::DbWeight::get().reads(3))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	// Storage: `HomaValidatorList::Guarantees` (r:1 w:1)
	// Proof: `HomaValidatorList::Guarantees` (`max_values`: None, `max_size`: Some(141), added: 2616, mode: `MaxEncodedLen`)
	fn rebond() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1044`
		//  Estimated: `3606`
		// Minimum execution time: 8_000 nanoseconds.
		Weight::from_parts(9_000_000, 3606)
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	// Storage: `HomaValidatorList::ValidatorBackings` (r:1 w:1)
	// Proof: `HomaValidatorList::ValidatorBackings` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
	// Storage: `HomaValidatorList::Guarantees` (r:1 w:1)
	// Proof: `HomaValidatorList::Guarantees` (`max_values`: None, `max_size`: Some(141), added: 2616, mode: `MaxEncodedLen`)
	// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
	// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `HomaValidatorList::TotalLockedByGuarantor` (r:1 w:1)
	// Proof: `HomaValidatorList::TotalLockedByGuarantor` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Locks` (r:1 w:1)
	// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1300), added: 3775, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:1 w:1)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	fn withdraw_unbonded() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2312`
		//  Estimated: `4765`
		// Minimum execution time: 40_000 nanoseconds.
		Weight::from_parts(41_000_000, 4765)
			.saturating_add(T::DbWeight::get().reads(6))
			.saturating_add(T::DbWeight::get().writes(5))
	}
	// Storage: `HomaValidatorList::ValidatorBackings` (r:10 w:10)
	// Proof: `HomaValidatorList::ValidatorBackings` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
	/// The range of component `n` is `[1, 10]`.
	fn freeze(n: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1235 + n * (71 ±0)`
		//  Estimated: `990 + n * (2540 ±0)`
		// Minimum execution time: 15_000 nanoseconds.
		Weight::from_parts(10_990_773, 990)
			// Standard Error: 8_735
			.saturating_add(Weight::from_parts(4_485_901, 0).saturating_mul(n.into()))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
			.saturating_add(Weight::from_parts(0, 2540).saturating_mul(n.into()))
	}
	// Storage: `HomaValidatorList::ValidatorBackings` (r:10 w:10)
	// Proof: `HomaValidatorList::ValidatorBackings` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
	/// The range of component `n` is `[1, 10]`.
	fn thaw(n: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1235 + n * (71 ±0)`
		//  Estimated: `990 + n * (2540 ±0)`
		// Minimum execution time: 15_000 nanoseconds.
		Weight::from_parts(11_502_223, 990)
			// Standard Error: 12_312
			.saturating_add(Weight::from_parts(4_428_242, 0).saturating_mul(n.into()))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
			.saturating_add(Weight::from_parts(0, 2540).saturating_mul(n.into()))
	}
	// Storage: `Homa::TotalStakingBonded` (r:1 w:0)
	// Proof: `Homa::TotalStakingBonded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Homa::ToBondPool` (r:1 w:0)
	// Proof: `Homa::ToBondPool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::TotalIssuance` (r:1 w:1)
	// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalVoidLiquid` (r:1 w:0)
	// Proof: `Homa::TotalVoidLiquid` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `HomaValidatorList::ValidatorBackings` (r:10 w:10)
	// Proof: `HomaValidatorList::ValidatorBackings` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
	// Storage: `HomaValidatorList::Guarantees` (r:20 w:10)
	// Proof: `HomaValidatorList::Guarantees` (`max_values`: None, `max_size`: Some(141), added: 2616, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:1 w:1)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `HomaValidatorList::TotalLockedByGuarantor` (r:1 w:1)
	// Proof: `HomaValidatorList::TotalLockedByGuarantor` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Locks` (r:1 w:1)
	// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1300), added: 3775, mode: `MaxEncodedLen`)
	/// The range of component `n` is `[1, 10]`.
	fn slash(n: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2834 + n * (200 ±0)`
		//  Estimated: `4765 + n * (5232 ±0)`
		// Minimum execution time: 57_000 nanoseconds.
		Weight::from_parts(30_420_201, 4765)
			// Standard Error: 30_290
			.saturating_add(Weight::from_parts(30_166_892, 0).saturating_mul(n.into()))
			.saturating_add(T::DbWeight::get().reads(7))
			.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into())))
			.saturating_add(T::DbWeight::get().writes(4))
			.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into())))
			.saturating_add(Weight::from_parts(0, 5232).saturating_mul(n.into()))
	}
}
